/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package classesEntidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author ra106797
 */
@Entity
@Table(name = "DISCIPLINACURRICULO")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Disciplinacurriculo.findAll", query = "SELECT d FROM Disciplinacurriculo d"),
    @NamedQuery(name = "Disciplinacurriculo.findById", query = "SELECT d FROM Disciplinacurriculo d WHERE d.id = :id"),
    @NamedQuery(name = "Disciplinacurriculo.findByIdcurriculo", query = "SELECT d FROM Disciplinacurriculo d WHERE d.disciplinacurriculoPK.idcurriculo = :idcurriculo"),
    @NamedQuery(name = "Disciplinacurriculo.findByIddisciplina", query = "SELECT d FROM Disciplinacurriculo d WHERE d.disciplinacurriculoPK.iddisciplina = :iddisciplina"),
    @NamedQuery(name = "Disciplinacurriculo.findByTiporelacao", query = "SELECT d FROM Disciplinacurriculo d WHERE d.disciplinacurriculoPK.tiporelacao = :tiporelacao"),
    @NamedQuery(name = "Disciplinacurriculo.findByIdgrupoeletiva", query = "SELECT d FROM Disciplinacurriculo d WHERE d.idgrupoeletiva = :idgrupoeletiva")})
public class Disciplinacurriculo implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected DisciplinacurriculoPK disciplinacurriculoPK;
    @Basic(optional = false)
    @Column(name = "ID")
    private int id;
    @Basic(optional = false)
    @Column(name = "IDGRUPOELETIVA")
    private int idgrupoeletiva;

    public Disciplinacurriculo() {
    }

    public Disciplinacurriculo(DisciplinacurriculoPK disciplinacurriculoPK) {
        this.disciplinacurriculoPK = disciplinacurriculoPK;
    }

    public Disciplinacurriculo(DisciplinacurriculoPK disciplinacurriculoPK, int id, int idgrupoeletiva) {
        this.disciplinacurriculoPK = disciplinacurriculoPK;
        this.id = id;
        this.idgrupoeletiva = idgrupoeletiva;
    }

    public Disciplinacurriculo(int idcurriculo, int iddisciplina, String tiporelacao) {
        this.disciplinacurriculoPK = new DisciplinacurriculoPK(idcurriculo, iddisciplina, tiporelacao);
    }

    public DisciplinacurriculoPK getDisciplinacurriculoPK() {
        return disciplinacurriculoPK;
    }

    public void setDisciplinacurriculoPK(DisciplinacurriculoPK disciplinacurriculoPK) {
        this.disciplinacurriculoPK = disciplinacurriculoPK;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getIdgrupoeletiva() {
        return idgrupoeletiva;
    }

    public void setIdgrupoeletiva(int idgrupoeletiva) {
        this.idgrupoeletiva = idgrupoeletiva;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (disciplinacurriculoPK != null ? disciplinacurriculoPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Disciplinacurriculo)) {
            return false;
        }
        Disciplinacurriculo other = (Disciplinacurriculo) object;
        if ((this.disciplinacurriculoPK == null && other.disciplinacurriculoPK != null) || (this.disciplinacurriculoPK != null && !this.disciplinacurriculoPK.equals(other.disciplinacurriculoPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "classesEntidades.Disciplinacurriculo[ disciplinacurriculoPK=" + disciplinacurriculoPK + " ]";
    }
    
}
